namespace GroupSix.Application.Dtos;

/// <summary>
/// 文章DTO
/// </summary>
public class ArticleDto
{
    /// <summary>
    /// 文章ID
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 文章标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 文章内容
    /// </summary>
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 文章摘要
    /// </summary>
    public string Summary { get; set; } = string.Empty;

    /// <summary>
    /// 文章分类ID
    /// </summary>
    public Guid CategoryId { get; set; }

    /// <summary>
    /// 文章分类名称
    /// </summary>
    public string CategoryName { get; set; } = string.Empty;

    /// <summary>
    /// 文章标签
    /// </summary>
    public string Tags { get; set; } = string.Empty;

    /// <summary>
    /// 文章状态
    /// </summary>
    public string Status { get; set; } = string.Empty;

    /// <summary>
    /// 作者ID
    /// </summary>
    public Guid AuthorId { get; set; }

    /// <summary>
    /// 作者名称
    /// </summary>
    public string AuthorName { get; set; } = string.Empty;

    /// <summary>
    /// 封面图片URL
    /// </summary>
    public string CoverImage { get; set; } = string.Empty;

    /// <summary>
    /// 阅读量
    /// </summary>
    public int ViewCount { get; set; }

    /// <summary>
    /// 点赞数
    /// </summary>
    public int LikeCount { get; set; }

    /// <summary>
    /// 评论数
    /// </summary>
    public int CommentCount { get; set; }

    /// <summary>
    /// 发布时间
    /// </summary>
    public DateTime? PublishedAt { get; set; }

    /// <summary>
    /// SEO标题
    /// </summary>
    public string SeoTitle { get; set; } = string.Empty;

    /// <summary>
    /// SEO关键词
    /// </summary>
    public string SeoKeywords { get; set; } = string.Empty;

    /// <summary>
    /// SEO描述
    /// </summary>
    public string SeoDescription { get; set; } = string.Empty;

    /// <summary>
    /// 是否置顶
    /// </summary>
    public bool IsTop { get; set; }

    /// <summary>
    /// 是否推荐
    /// </summary>
    public bool IsRecommend { get; set; }

    /// <summary>
    /// 排序权重
    /// </summary>
    public int SortWeight { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime UpdatedAt { get; set; }
}

/// <summary>
/// 文章查询DTO
/// </summary>
public class ArticleQueryDto
{
    /// <summary>
    /// 文章标题（模糊查询）
    /// </summary>
    public string? Title { get; set; }

    /// <summary>
    /// 文章分类ID
    /// </summary>
    public Guid? CategoryId { get; set; }

    /// <summary>
    /// 文章状态
    /// </summary>
    public string? Status { get; set; }

    /// <summary>
    /// 作者名称（模糊查询）
    /// </summary>
    public string? AuthorName { get; set; }

    /// <summary>
    /// 是否置顶
    /// </summary>
    public bool? IsTop { get; set; }

    /// <summary>
    /// 是否推荐
    /// </summary>
    public bool? IsRecommend { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    public DateTime? EndTime { get; set; }

    /// <summary>
    /// 页码
    /// </summary>
    public int Page { get; set; } = 1;

    /// <summary>
    /// 页大小
    /// </summary>
    public int PageSize { get; set; } = 20;
}

/// <summary>
/// 创建文章请求DTO
/// </summary>
public class CreateArticleRequestDto
{
    /// <summary>
    /// 文章标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 文章内容
    /// </summary>
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 文章摘要
    /// </summary>
    public string Summary { get; set; } = string.Empty;

    /// <summary>
    /// 文章分类ID
    /// </summary>
    public Guid CategoryId { get; set; }

    /// <summary>
    /// 文章标签
    /// </summary>
    public string Tags { get; set; } = string.Empty;

    /// <summary>
    /// 文章状态
    /// </summary>
    public string Status { get; set; } = "draft";

    /// <summary>
    /// 作者ID
    /// </summary>
    public Guid AuthorId { get; set; }

    /// <summary>
    /// 封面图片URL
    /// </summary>
    public string CoverImage { get; set; } = string.Empty;

    /// <summary>
    /// SEO标题
    /// </summary>
    public string SeoTitle { get; set; } = string.Empty;

    /// <summary>
    /// SEO关键词
    /// </summary>
    public string SeoKeywords { get; set; } = string.Empty;

    /// <summary>
    /// SEO描述
    /// </summary>
    public string SeoDescription { get; set; } = string.Empty;

    /// <summary>
    /// 排序权重
    /// </summary>
    public int SortWeight { get; set; } = 0;
}

/// <summary>
/// 更新文章请求DTO
/// </summary>
public class UpdateArticleRequestDto
{
    /// <summary>
    /// 文章标题
    /// </summary>
    public string Title { get; set; } = string.Empty;

    /// <summary>
    /// 文章内容
    /// </summary>
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 文章摘要
    /// </summary>
    public string Summary { get; set; } = string.Empty;

    /// <summary>
    /// 文章分类ID
    /// </summary>
    public Guid CategoryId { get; set; }

    /// <summary>
    /// 文章标签
    /// </summary>
    public string Tags { get; set; } = string.Empty;

    /// <summary>
    /// 文章状态
    /// </summary>
    public string Status { get; set; } = string.Empty;

    /// <summary>
    /// 封面图片URL
    /// </summary>
    public string CoverImage { get; set; } = string.Empty;

    /// <summary>
    /// SEO标题
    /// </summary>
    public string SeoTitle { get; set; } = string.Empty;

    /// <summary>
    /// SEO关键词
    /// </summary>
    public string SeoKeywords { get; set; } = string.Empty;

    /// <summary>
    /// SEO描述
    /// </summary>
    public string SeoDescription { get; set; } = string.Empty;

    /// <summary>
    /// 排序权重
    /// </summary>
    public int SortWeight { get; set; } = 0;
}

/// <summary>
/// 批量删除请求DTO
/// </summary>
public class BatchDeleteRequestDto
{
    /// <summary>
    /// 要删除的文章ID列表
    /// </summary>
    public List<Guid> Ids { get; set; } = new();
}

/// <summary>
/// 文章统计信息DTO
/// </summary>
public class ArticleStatisticsDto
{
    /// <summary>
    /// 总文章数
    /// </summary>
    public int TotalArticles { get; set; }

    /// <summary>
    /// 已发布文章数
    /// </summary>
    public int PublishedArticles { get; set; }

    /// <summary>
    /// 草稿文章数
    /// </summary>
    public int DraftArticles { get; set; }

    /// <summary>
    /// 下线文章数
    /// </summary>
    public int OfflineArticles { get; set; }

    /// <summary>
    /// 总阅读量
    /// </summary>
    public int TotalViews { get; set; }

    /// <summary>
    /// 总点赞数
    /// </summary>
    public int TotalLikes { get; set; }

    /// <summary>
    /// 总评论数
    /// </summary>
    public int TotalComments { get; set; }

    /// <summary>
    /// 今日新增文章数
    /// </summary>
    public int TodayNewArticles { get; set; }

    /// <summary>
    /// 今日阅读量
    /// </summary>
    public int TodayViews { get; set; }

    /// <summary>
    /// 置顶文章数
    /// </summary>
    public int TopArticles { get; set; }

    /// <summary>
    /// 推荐文章数
    /// </summary>
    public int RecommendArticles { get; set; }
}

/// <summary>
/// 文章分类DTO
/// </summary>
public class ArticleCategoryDto
{
    /// <summary>
    /// 分类ID
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 分类名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 分类描述
    /// </summary>
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 父分类ID
    /// </summary>
    public Guid? ParentId { get; set; }

    /// <summary>
    /// 分类层级
    /// </summary>
    public int Level { get; set; }

    /// <summary>
    /// 排序顺序
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime UpdatedAt { get; set; }
} 